import Doc from '~/components/layout/docs'
import { Image } from '~/components/media'
import Caption from '~/components/text/caption'
import Collapse, { CollapseGroup } from '~/components/collapse'
import BitbucketDefaultBehaviour from '~/components/git-mdx/bitbucket/default-behaviour.mdx'
import BitbucketEnvironmentVariables from '~/components/git-mdx/bitbucket/environment-variables.mdx'

export const meta = {
  title: 'ZEIT Now for Bitbucket',
  description:
    'Deploy each change in your Bitbucket projects with ZEIT Now to share and test with your colleagues. Instant share-able links to your work with each push. Automatically make your changes available from production domains.',
  editUrl: 'pages/docs/v2/git-integrations/zeit-now-for-bitbucket.mdx',
  lastEdited: '2020-01-24T23:33:43.000Z'
}

The ZEIT Now for Bitbucket integration automatically deploys your Bitbucket projects with [ZEIT Now](/), providing [Preview Deployment URLs](/docs/v2/platform/deployments#preview), and automatic [Custom Domain](/docs/v2/custom-domains) updates.

<Image
  src={`${process.env.ASSETS}/docs/now-for-bitbucket/project-commit.png`}
  width={2240/2.5}
  height={1282/2.5}
/>
<Caption style={{marginTop: '-40px'}}>Commits pushed to Bitbucket are automatically built and deployed with Now.</Caption>

### Connecting with Bitbucket

Get started from your dashboard by clicking the ["New Project"](/new) button followed by "Connect with Bitbucket" from the "Bitbucket" tab under "From your existing code".

<Image
  src={`${process.env.ASSETS}/docs/git-integrations/connect-bitbucket.png`}
  width={1184 / 2}
  height={622 / 2}
  shadow
  borderRadius
/>
<Caption>ZEIT Now for Bitbucket, ready to connect.</Caption>

Once you have authorized the Bitbucket integration, you will redirect back to the "New Project" page where you can create a new project from an existing repository by clicking the "New Project from Bitbucket" button under the "Bitbucket" tab or by selecting a template and creating a Bitbucket repo from it.

For more information on deploying projects, read [the ZEIT Now introduction documentation](/docs).

### More Information About ZEIT Now for Bitbucket

For more information, such as a reference for default environment variables, expand the relevant details view below.

<CollapseGroup>
  <Collapse title="Default Behaviour">
    <BitbucketDefaultBehaviour />
  </Collapse>

<Collapse title="Included Environment Variables">
    <BitbucketEnvironmentVariables />
  </Collapse>
</CollapseGroup>

export default ({ children }) => <Doc meta={meta}>{children}</Doc>

export const config = {
  amp: 'hybrid'
}
